package com.mkyong.test;

import com.sun.jersey.api.client.Client;
import com.sun.jersey.api.client.ClientResponse;
import com.sun.jersey.api.client.WebResource;

public class JerseyClient {
	
	public static void main(String[] args)throws Exception {
		Client client = Client.create();
		WebResource webResource = client.resource("http://localhost:7080/services/rest/admin/cabbooking/add");
		String input = "{\"destination\":\"Garia\",\"office\":\"Ecospace III\"}";
		ClientResponse response = webResource.type("application/json").post(ClientResponse.class, input);
		System.out.println(response.getStatus()); 
		System.out.println(response.getType());
//		CabbookingRequest cabbookingRequest = response.getEntity(CabbookingRequest.class);
//		System.out.println(cabbookingRequest.getRequestId());
//		System.out.println(cabbookingRequest.getBookingSatus());
		System.out.println(response.getEntity(String.class));
	}

}
